// 节流函数
export default function throttle(fn, delay = 2000) {
    let timer = null;
    return function () {
      if (timer) return;
      fn.apply(this, arguments);
      timer = setTimeout(() => {
        timer = null;
      }, delay);
    };
  }
  
  
  